<?php 
	include 'db.php';
	ob_start();
	$user=$_POST['myuser']; 
	$pass=$_POST['mypass']; 
	
	$user = stripslashes($user);
	$pass = stripslashes($pass);
	$user = mysql_real_escape_string($user);
	$pass = mysql_real_escape_string($pass);
	$sql="SELECT * FROM members WHERE user='$user' and pass='$pass'";
	$result=  mysql_query($sql);
	$row=mysql_num_rows($result);
	echo 'hey : '.$row;	
	if($row == 1){
		session_start();
		$_SESSION['user'] = $user;
		header("location:adminpage.php?view=1");
	}else{
		header("location:led-admin.php?action=logerror");
	}
	ob_end_flush();
?>